<?php
include_once("functions/db_manipulate.php");

if (!init()) {
    redirect("?action&login");
    exit();
}

?>
    <meta charset="UTF-8">

<?php

connectDB();
startTransaction();

$resultSet = mysql_query("INSERT INTO sections(header) VALUES ('" . mysql_real_escape_string($_POST['header']) . "')") or die(mysql_error());

if ($resultSet) {
    commitTransaction();
} else {
    rollbackTransaction();
}

redirect($_SERVER['HTTP_REFERER']);